﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ComponentModel;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "AddCountry"
            )]
        [Description("添加国家")]
        Chinaer.Model.Common.JsonResult AddCountry(DTO.CountryDTO countryDTO);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "DeleteCountry"
            )]
        [Description("删除国家")]
        Chinaer.Model.Common.JsonResult DeleteCountry(DTO.CountryDTO countryDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "DeleteCountryByID/{countryID}/{apiToken}"
            )]
        [Description("根据国家编号删除国家")]
        Chinaer.Model.Common.JsonResult DeleteCountryByID(string countryID, string apiToken);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "UpdateCountry"
            )]
        [Description("根据国家编号删除国家")]
        Chinaer.Model.Common.JsonResult UpdateCountry(DTO.CountryDTO countryDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "GetCountryByID/{countryID}/{apiToken}"
            )]
        [Description("根据国家编号删除国家")]
        DTO.CountryDTO GetCountryByID(string countryID,string apiToken);


        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "GetAllCountry/{apiToken}"
            )]
        [Description("获取所有国家数据")]
        List<DTO.CountryDTO> GetAllCountry(string apiToken);

    }
}
